<!DOCTYPE html>
<html lang="en">

<head>
    <title>战队PK</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
    <script src="../../js/jquery-3.2.1.min.js"></script>
    <link rel="stylesheet" href="../../css/public.css">
    <style>
        .register_bg {
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            right: 0;
            background: url('../images/reg/bg.png') center no-repeat;
            background-size: 100%;
            z-index: 1;
        }

      

        .home_zhangdui_nav {
            padding-left: 30%;
            overflow: hidden;
            background: #021349 url('../../images/reg/back.png') 10px center no-repeat;
            background-size: .7rem;
        }
        .history{
            margin-top: 5px;
            float: right;
            height: 45px;
            width: 45px;
            margin-right: 5px;
            color: #FAE7A5;
            background: url(../../images/home/icon_record.png)center no-repeat;
            background-size: .65rem;
        }
        .service{
            margin-top: 5px;
            float: right;
            height: 45px;
            width: 45px;
            margin-right: 5px;
            color: #FAE7A5;
            /* background: url(../../images/home/icon_service.png)center no-repeat; */
            background-size: .6rem;
        }
        .guese-logo{
            margin-top: 60px;
            
        }
        .guese-logo img{
            display: block;
            margin: auto;
            /* width: auto; */
        }
        .team .pk{
           float: left;
           margin-left: 6%;
           background: url(../../images/home/btm_issue.png ) center no-repeat;
        }
        .team .competition{
            float: right;
            margin-right: 6%;
            background: url(../../images/home/btm_challenge.png) center no-repeat;
        }
       .team .pk ,.team .competition{
        
           height: 65px;
           width: 40%;
           background-size: 100%;
           border: 0;
        }
        .team a{
            margin-bottom: 3px;
            display: block;
            font-size: 17px;
            color: #1D1104;
            font-weight: 700;
        }
      
        .systemMsg{
            
            position: absolute;
            left: 0;
            right: 0;
            bottom: 15%;
            font-size: 12px;
            height: 133px;
            width: 90%;
            background: url('../../images/home/msg_bg.png') center no-repeat;
            background-size: 100%;
            margin: auto;
            padding-left: 10px;

        }
        .systemMsg .msgTag{
            text-align: center;
            font-size: 17px;
            color: #FFB400;
            margin-top: 17px;
        }
        .systemMsg .msgContent{
            height: 72px;

            margin: 4px 14px;
            font-size: 13px;
            line-height: 23px;
            overflow : hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
        }

        .roomNum{
            display: block;
            position: absolute;
            top: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 99;
            color: #FFCD29 ;
            font-size: .4rem;
            text-align: center;
            letter-spacing: 3px;
            font-weight: 540;
            font-size: .45rem
        }
        .num{
            display: flex;
            width: 90%;
            margin: auto;
            margin-top: 5%;
            color: #fff;
            text-align: center;
        }
        .num div{
            flex: 1;
            
        }
        .num input{
            display: block;
            width: 60%;
            margin: auto;
            height: 120%;
            background: #241564;
            border-radius: 5px;
            border: 1px solid #E4BF5F ;
            text-align: center;
            color: #fff;
        }
        .roomContain{
            position: absolute;
            height: 20%;
            background: url(../../images/home/bg_home_team_number.png) no-repeat;
            background-size: 100%;
            width: 80%;
            left: 10%;
            top: 20%;
            padding-top: 3%;
        }

    </style>
</head>

<body>

    <div class="register_bg">
        
        <div class="home_zhangdui_nav">
            <span class="goBack"></span>
            战队PK
            <a href=""><span class="service"></span></a>
            <a href="./ChallengeRecord.html"><span class="history"></span></a>
            
        </div>
        <div class="guese-logo">  <img src="../../images/home/bg_pk.png" alt="">  </div>
        <div class="team">
                <button class="pk"><a href="#">发布战局</a></button> 
                <!-- <button class="competition"><a href="./ChooseAChallengeRoom.html">挑战战局</a></button> -->
                <button class="competition"><a href="#">挑战战局</a></button>
                <div class="clear"></div>
        </div>
           <div class="systemMsg">
               <div class="msgTag">必读公告</div>
               <div class="msgContent">
                    恭喜13886646599参与王者荣耀竞猜获得89798王者币恭喜程序从分公司单个发送割发代首感受到分公司电饭锅阿萨德干啥的分公司电饭锅阿萨德刚发的啊发斯蒂芬啊发斯蒂芬啊发顺丰的所发生的。
                   </div>
               <div style="clear:both;"></div>
           </div>      
    </div>

    <script src="../../js/public.js"></script>
    <script>
        // $(function(){
        //     $.post(userInfoUrl,res=>{
        //         let userId=res.obj.fdId
        //         if(res.code==0){
        //             $.post(isFighting,res=>{
        //       if(res.code==0){
        //           if(userId==res.obj.fdCreateId){
        //             window.location.href=`./addPic.html?warId=${res.obj.fdId}&picType=0`
        //             console.log(res.obj.fdId)
        //           }
        //           else if(userId==res.obj.fdDareId){
        //             window.location.href=`./addPic.html?warId=${res.obj.fdId}&picType=1`
        //           }
        //       }
        //     })
        //         }
        //     })
        // })
        
        $(function() {
            // let localStorage.fdId
            $.post(zdpkUrl, {
                type: 0
            }, (res) => {
                // console.log(res)
                // console.log(res.obj)
                $('.pk').on('click', function(){
                    localStorage.usertype = 1;
                    if(res.msg == 0) {
                        window.location.href='./fbzj.html';
                    }else {
                        let roomid = res.obj.fdId;
                        let roomname =res.obj.fdWarName;
                        let pswnum = res.obj.fdPwd;
                        localStorage.roomid = roomid;
                        localStorage.pswnum = pswnum;
                        console.log(pswnum)
                        alert(res.msg);
                        window.location.href='./addPic.html?id='+roomname;
                    }
                })
            });
             
            $.post(zdpkUrl, {
                type: 1
            }, (res) => {
                console.log(res)
                $('.competition').on('click', function(){
                    if(res.msg == 0){
                        localStorage.usertype = 2;
                        window.location.href='./ModalFrame.html';
                    }else {
                        let roomid = res.obj.fdId;
                        let roomname =res.obj.fdWarName;
                        localStorage.roomid = roomid;
                        localStorage.roomname = roomname;
                        alert(res.msg);
                        localStorage.usertype = 1;
                        window.location.href='./addPic.html?id='+roomname;
                    } 
                })
            });
            //公告
            $.post(systemNotice, {
                type: 2
            }, (res) => {
                let obj = res.obj;
                obj.forEach((item, index) => {
                    if (index == 0) {
                        $('.msgContent').text((item.fdContent))
                    } 
                });
            });
            $('.msgContent').click(function(){
                window.location.href='./activity.html?type=2'
            })
        })
    </script>
</body>

</html>